package cn.maihe.elg.operation.centers.hymake.dto.channel.vo.xm;

import lombok.Data;

import javax.xml.bind.annotation.*;
import java.math.BigDecimal;
import java.util.Date;

@XmlRootElement(name = "DZBH")
@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class ElectronicGuarantee {

    /**
     * 对DZBHINFO整个节点的字符串进行去除空格，转大写后的获取的 MD5哈希值，用于验证DZBHINFO节点完整性。
     */
    @XmlElement(name = "DZBHMD5")
    private String dzbhMd5;

    /**
     * 详细结构化数据的节点
     */
    @XmlElement(name = "DZBHINFO")
    private DzbhInfo dzbhInfo;

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class DzbhInfo {

        /**
         * 电子投标保函订单号
         */
        @XmlElement(name = "ORDER_ID")
        private String orderId;

        /**
         * 保函编号
         */
        @XmlElement(name = "GUARANTEE_NO")
        private String guaranteeNo;

        /**
         * 4.3.8 招标项目和标段信息
         */
        @XmlElement(name = "TENDER_INFO")
        private TenderInfo tenderInfo;

        /**
         * 4.3.9 工程担保保证人信息
         */
        @XmlElement(name = "GUARANTOR")
        private Guarantor guarantor;

        /**
         * 4.3.7 投标人信息
         */
        @XmlElement(name = "BIDDER")
        private Bidder bidder;

        /**
         * 4.3.5 保函基本信息
         */
        @XmlElement(name = "GUARANTEE_INFO")
        private GuaranteeInfo guaranteeInfo;

        /**
         * 4.3.6 受益人信息
         */
        @XmlElement(name = "BENEFICIARY_INFO")
        private BeneficiaryInfo beneficiaryInfo;

        /**
         * 4.3.11 附件信息
         */
        @XmlElement(name = "GUARANTEE_ATTACHMENT")
        private GuaranteeAttachment guaranteeAttachment;

        /**
         * 4.3.10 发票信息
         */
        @XmlElement(name = "INVOICE_INFO")
        private InvoiceInfo invoiceInfo;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class GuaranteeInfo {
        /**
         * 保函编号
         */
        @XmlAttribute(name = "GUARANTEE_NO")
        private String guaranteeNo;

        /**
         * 保函签发日期
         */
        @XmlAttribute(name = "CREATE_TIME")
        private Date createTime;

        /**
         * 保函生效日期
         */
        @XmlAttribute(name = "SERVICE_BEGIN_TIME")
        private Date serviceBeginTime;

        /**
         * 保函失效日期
         */
        @XmlAttribute(name = "SERVICE_END_TIME")
        private Date serviceEndTime;

        /**
         * 担保额度（保证金要求数额）(元)
         */
        @XmlAttribute(name = "BID_BOND")
        private Double bidBond;

        /**
         * 保费（元）
         */
        @XmlAttribute(name = "AMOUNT")
        private Double amount;

        /**
         * 费率（百分号）如千分五填0.5
         */
        @XmlAttribute(name = "RATE")
        private Double rate;

        /**
         * 支付方式
         */
        @XmlAttribute(name = "PAY_TYPE")
        private String payType;

        /**
         * 支付账号（银行账号）
         */
        @XmlAttribute(name = "PAY_ACCOUNT")
        private String payAccount;

        /**
         * 支付人姓名（银行账户名称）
         */
        @XmlAttribute(name = "PAY_NAME")
        private String payName;

        /**
         * 支付人联系方式
         */
        @XmlAttribute(name = "PAY_PHONE")
        private String payPhone;

        /**
         * 银行开户行
         */
        @XmlAttribute(name = "PAY_BANK_OPENBANK")
        private String payBankOpenBank;

        /**
         * 担保责任：一般保证、连带责任保证、独立保函
         */
        @XmlAttribute(name = "GUARANTEE_DUTY")
        private String guaranteeDuty;

        /**
         * 从属性：独立保函、从合同
         */
        @XmlAttribute(name = "GUARANTEE_PROPERTY")
        private String guaranteeProperty;

        /**
         * 索赔条款
         */
        @XmlAttribute(name = "CLAIM_CLAUSE")
        private String claimClause;

        /**
         * 赔付时效
         */
        @XmlAttribute(name = "PAY_LIMITATION")
        private Integer payLimitation;

        /**
         * 银保监产品备案编号，保险机构应当提供
         */
        @XmlAttribute(name = "BANK_RECORD_NO")
        private String bankRecordNo;

        /**
         * 适用法律：担保法、保险法、《独立保函司法解释》（法释〔2016〕24号）
         */
        @XmlAttribute(name = "APPLICABLE_LAW")
        private String applicableLaw;

        /**
         * 备注
         */
        @XmlAttribute(name = "REMARK")
        private String remark;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class BeneficiaryInfo {
        /**
         * 受益人名称
         */
        @XmlAttribute(name = "BENEFICIARY")
        private String beneficiary;

        /**
         * 受益人统一社会信用代码
         */
        @XmlAttribute(name = "BENEFICIARY_CREDIT_CODE")
        private String beneficiaryCreditCode;

        /**
         * 受益人银行账户名称
         */
        @XmlAttribute(name = "BENEFICIARY_BANK_ACCOUNT")
        private String beneficiaryBankAccount;

        /**
         * 受益人银行账号
         */
        @XmlAttribute(name = "BENEFICIARY_BANK_CODE")
        private String beneficiaryBankCode;

        /**
         * 受益人银行开户行
         */
        @XmlAttribute(name = "BENEFICIARY_BANK_OPENBANK")
        private String beneficiaryBankOpenBank;

        /**
         * 受益人联系人姓名
         */
        @XmlAttribute(name = "BENEFICIARY_CONTACT")
        private String beneficiaryContact;

        /**
         * 受益人联系人联系方式
         */
        @XmlAttribute(name = "BENEFICIARY_CONTACT_TEL")
        private String beneficiaryContactTel;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class Bidder {
        /**
         * 投标人名称
         */
        @XmlAttribute(name = "BIDDER_NAME")
        private String bidderName;

        /**
         * 投标人统一社会信用代码
         */
        @XmlAttribute(name = "BIDDER_CREDIT_CODE")
        private String bidderCreditCode;

        /**
         * 投标人联系人姓名
         */
        @XmlAttribute(name = "BIDDER_CONTACT_NAME")
        private String bidderContactName;

        /**
         * 投标人联系电话
         */
        @XmlAttribute(name = "BIDDER_CONTACT_TEL")
        private String bidderContactTel;

        /**
         * 投标人联系人身份证件号码
         */
        @XmlAttribute(name = "BIDDER_CONTACT_IDCARD")
        private String bidderContactIdCard;

        /**
         * 投标人联系人身份证件类型
         */
        @XmlAttribute(name = "BIDDER_CONTACT_IDCARD_TYPE")
        private String bidderContactIdCardType;

        /**
         * 投标人地址
         */
        @XmlAttribute(name = "BIDDER_ADDRESS")
        private String bidderAddress;

        /**
         * 投标人邮箱
         */
        @XmlAttribute(name = "BIDDER_EMAIL")
        private String bidderEmail;

        /**
         * 投标人法定代表人姓名
         */
        @XmlAttribute(name = "LEGAL_PERSON_NAME")
        private String legalPersonName;

        /**
         * 投标人法定代表人身份证件号码
         */
        @XmlAttribute(name = "LEGAL_PERSON_IDCARD")
        private String legalPersonIdCard;

        /**
         * 投标人法定代表人身份证件类型
         */
        @XmlAttribute(name = "LEGAL_PERSON_IDCARD_TYPE")
        private String legalPersonIdCardType;

        /**
         * 投标人法定代表人联系方式
         */
        @XmlAttribute(name = "LEGAL_PERSON_TEL")
        private String legalPersonTel;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class TenderInfo {
        /**
         * 项目审批文号
         */
        @XmlAttribute(name = "APPROVAL_CODE")
        private String approvalCode;

        /**
         * 投资项目统一代码
         */
        @XmlAttribute(name = "INVEST_PROJECT_CODE")
        private String investProjectCode;

        /**
         * 招标项目编号
         */
        @XmlAttribute(name = "TENDER_PROJECT_CODE")
        private String tenderProjectCode;

        /**
         * 招标项目名称
         */
        @XmlAttribute(name = "TENDER_PROJECT_NAME")
        private String tenderProjectName;

        /**
         * 标段编号
         */
        @XmlAttribute(name = "SECTION_CODE")
        private String sectionCode;

        /**
         * 标段名称
         */
        @XmlAttribute(name = "SECTION_NAME")
        private String sectionName;

        /**
         * 合同估算价（元）
         */
        @XmlAttribute(name = "CONTRACT_RECKON_PRICE")
        private Double contractReckonPrice;

        /**
         * 招标人
         */
        @XmlAttribute(name = "TENDERER")
        private String tenderer;

        /**
         * 招标人统一社会信用代码
         */
        @XmlAttribute(name = "TENDERER_CREDIT_CODE")
        private String tendererCreditCode;

        /**
         * 招标人银行账号
         */
        @XmlAttribute(name = "TENDERER_BANK_CODE")
        private String tendererBankCode;

        /**
         * 招标人银行开户行
         */
        @XmlAttribute(name = "TENDERER_BANK_OPENBANK")
        private String tendererBankOpenBank;

        /**
         * 招标人银行账户名称
         */
        @XmlAttribute(name = "TENDERER_BANK_ACCOUNT")
        private String tendererBankAccount;

        /**
         * 招标人联系人
         */
        @XmlAttribute(name = "TENDERER_CONTACT")
        private String tendererContact;

        /**
         * 招标人联系人联系方式
         */
        @XmlAttribute(name = "TENDERER_CONTACT_TEL")
        private String tendererContactTel;

        /**
         * 招标人联系地址
         */
        @XmlAttribute(name = "TENDERER_CONTACT_ADDRESS")
        private String tendererContactAddress;

        /**
         * 招标类型（施工、勘察、设计等）
         */
        @XmlAttribute(name = "INVITE_TYPE")
        private String inviteType;

        /**
         * 项目建设地点
         */
        @XmlAttribute(name = "PROJECT_ADDRESS")
        private String projectAddress;

        /**
         * 计划工期
         */
        @XmlAttribute(name = "PROJECT_DAYS")
        private String projectDays;

        /**
         * 项目所在地(行政区划代码)
         */
        @XmlAttribute(name = "CITY_CODE")
        private String cityCode;

        /**
         * 招标项目类别
         */
        @XmlAttribute(name = "TENDER_PROJECT_TYPE")
        private String tenderProjectType;

        /**
         * 开标时间（YYYYMMDDHHMMSS）
         */
        @XmlAttribute(name = "BID_OPEN_TIME")
        private Date bidOpenTime;

        /**
         * 投标有效期，单位天
         */
        @XmlAttribute(name = "VALID_PERIOD")
        private Integer validPeriod;

        /**
         * 担保额度（保证金要求数额）（元）
         */
        @XmlAttribute(name = "BID_BOND")
        private Double bidBond;

        /**
         * 招标公告地址
         */
        @XmlAttribute(name = "TENDER_NOTICE_URL")
        private String tenderNoticeUrl;

        /**
         * 招标文件下载地址
         */
        @XmlAttribute(name = "TENDER_FILE_URL")
        private String tenderFileUrl;

        /**
         * 招标文件大写 MD5 码
         */
        @XmlAttribute(name = "TENDER_FILE_MD5")
        private String tenderFileMd5;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class Guarantor {
        /**
         * 工程担保保证人名称
         */
        @XmlAttribute(name = "GUARANTOR_NAME")
        private String guarantorName;

        /**
         * 工程担保保证人统一社会信用代码
         */
        @XmlAttribute(name = "GUARANTOR_CREDIT_CODE")
        private String guarantorCreditCode;

        /**
         * 工程担保保证人法定代表人
         */
        @XmlAttribute(name = "GUARANTOR_LEGAL_PERSON")
        private String guarantorLegalPerson;

        /**
         * 法定代表人证件类型
         */
        @XmlAttribute(name = "GUARANTOR_LEGAL_IDCARD_TYPE")
        private String guarantorLegalIdCardType;

        /**
         * 法定代表人证件号
         */
        @XmlAttribute(name = "GUARANTOR_LEGAL_IDCARD")
        private String guarantorLegalIdCard;

        /**
         * 银行行号，银行需要填写
         */
        @XmlAttribute(name = "BANK_CODE")
        private String bankCode;

        /**
         * 工程担保保证人地址
         */
        @XmlAttribute(name = "GUARANTOR_ADDRESS")
        private String guarantorAddress;

        /**
         * 工程担保保证人电子邮箱
         */
        @XmlAttribute(name = "GUARANTOR_EMAIL")
        private String guarantorEmail;

        /**
         * 工程担保保证人邮政编码
         */
        @XmlAttribute(name = "GUARANTOR_POSTCODE")
        private String guarantorPostcode;

        /**
         * 工程担保保证人电话
         */
        @XmlAttribute(name = "GUARANTOR_PHONE")
        private String guarantorPhone;

        /**
         * 工程担保保证人传真
         */
        @XmlAttribute(name = "GUARANTOR_TAX")
        private String guarantorTax;

        /**
         * 工程担保保证人业务联系人
         */
        @XmlAttribute(name = "GUARANTOR_BUSSINESS_NAME")
        private String guarantorBussinessName;

        /**
         * 工程担保保证人业务联系电话
         */
        @XmlAttribute(name = "GUARANTOR_BUSSINESS_TEL")
        private String guarantorBussinessTel;

        /**
         * 工程担保保证人技术联系人
         */
        @XmlAttribute(name = "GUARANTOR_TECHNOLOGY_NAME")
        private String guarantorTechnologyName;

        /**
         * 工程担保保证人技术联系电话
         */
        @XmlAttribute(name = "GUARANTOR_TECHNOLOGY_TEL")
        private String guarantorTechnologyTel;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class InvoiceInfo {
        /**
         * 票头
         */
        @XmlAttribute(name = "INVOICE_TITLE")
        private String invoiceTitle;

        /**
         * 发票号（字轨号）
         */
        @XmlAttribute(name = "INVOICE_NO")
        private String invoiceNo;

        /**
         * 客户名称
         */
        @XmlAttribute(name = "CUSTOMER_NAME")
        private String customerName;

        /**
         * 纳税人识别号
         */
        @XmlAttribute(name = "CUSTOMER_CREDIT_CODE")
        private String customerCreditCode;

        /**
         * 客户开户账号
         */
        @XmlAttribute(name = "CUSTOMER_BANK_CODE")
        private String customerBankCode;

        /**
         * 客户开户行
         */
        @XmlAttribute(name = "CUSTOMER_OPNE_BANK")
        private String customerOpenBank;

        /**
         * 客户地址
         */
        @XmlAttribute(name = "CUSTOMER_ADDRESS")
        private String customerAddress;

        /**
         * 客户电话
         */
        @XmlAttribute(name = "CUSTOMER_PHONE")
        private String customerPhone;

        /**
         * 商品名称
         */
        @XmlAttribute(name = "PRODUCT_NAME")
        private String productName;

        /**
         * 金额小写
         */
        @XmlAttribute(name = "AMOUNT")
        private Double amount;

        /**
         * 金额大写
         */
        @XmlAttribute(name = "AMOUNT_OF_CHINAESE")
        private String amountOfChinese;

        /**
         * 开票日期
         */
        @XmlAttribute(name = "OPEN_TIME")
        private Date openTime;

        /**
         * 销售人名称
         */
        @XmlAttribute(name = "SELLER_NAME")
        private String sellerName;

        /**
         * 销售人统一社会信用代码
         */
        @XmlAttribute(name = "SELLER_CREDIT_CODE")
        private String sellerCreditCode;

        /**
         * 销售人开户账号
         */
        @XmlAttribute(name = "SELLER_BANK_CODE")
        private String sellerBankCode;

        /**
         * 销售人开户行
         */
        @XmlAttribute(name = "SELLER_OPEN_BANK")
        private String sellerOpenBank;

        /**
         * 销售人地址
         */
        @XmlAttribute(name = "SELLER_ADDRESS")
        private String sellerAddress;

        /**
         * 销售人电话
         */
        @XmlAttribute(name = "SELLER_PHONE")
        private String sellerPhone;

        /**
         * 经办人
         */
        @XmlAttribute(name = "HANDLER")
        private String handler;

        /**
         * 备注
         */
        @XmlAttribute(name = "INVOICE_REMARK")
        private String invoiceRemark;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @Data
    public static class GuaranteeAttachment {
        /**
         * 电子保单（合同）原文件名
         */
        @XmlAttribute(name = "WARRANTY_FILE_NAME")
        private String warrantyFileName;

        /**
         * 电子保单原（合同）文件大写MD5
         */
        @XmlAttribute(name = "WARRANTY_MD5")
        private String warrantyMd5;

        /**
         * 电子保单（合同）pdf文件名
         */
        @XmlAttribute(name = "WARRANTY_PDF_FILE_NAME")
        private String warrantyPdfFileName;

        /**
         * 电子保单（合同）pdf文件大写MD5
         */
        @XmlAttribute(name = "WARRANTY_PDF_MD5")
        private String warrantyPdfMd5;

        /**
         * 电子保函申请单文件名
         */
        @XmlAttribute(name = "ORDER_FILE_NAME")
        private String orderFileName;

        /**
         * 电子保函申请单文件大写MD5码
         */
        @XmlAttribute(name = "ORDER_MD5")
        private String orderMd5;

        /**
         * 电子保函申请单PDF文件名
         */
        @XmlAttribute(name = "ORDER_PDF_FILE_NAME")
        private String orderPdfFileName;

        /**
         * 电子保函申请单PDF文件大写MD5码
         */
        @XmlAttribute(name = "ORDER_PDF_MD5")
        private String orderPdfMd5;

        /**
         * 企业资质文件名称
         */
        @XmlAttribute(name = "QUALIFICATION_FILE_NAME")
        private String qualificationFileName;

        /**
         * 企业资质文件大写MD5码
         */
        @XmlAttribute(name = "QUALIFICATION_FILE_MD5")
        private String qualificationFileMd5;

        /**
         * 企业营业执照名称
         */
        @XmlAttribute(name = "BUSINESS_LICENSE_FILE_NAME")
        private String businessLicenseFileName;

        /**
         * 企业营业执照大写MD5码
         */
        @XmlAttribute(name = "BUSINESS_LICENSE_MD5")
        private String businessLicenseMd5;

        /**
         * 其他附件文件名，多个其他附件以压缩包方式存放
         */
        @XmlAttribute(name = "OTHER_FILE_NAME")
        private String otherFileName;

        /**
         * 其他附件大写MD5码
         */
        @XmlAttribute(name = "OTHER_FILE_MD5")
        private String otherFileMd5;
    }
}
